package com.lcq.gulimall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lcq.common.to.OrderItemLockTo;
import com.lcq.common.to.OrderTo;
import com.lcq.common.to.StockLockedTo;
import com.lcq.common.utils.PageUtils;
import com.lcq.gulimall.ware.entity.WareSkuEntity;
import com.lcq.gulimall.ware.vo.SkuStockVo;
import com.lcq.gulimall.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author lichuanqi
 * @email lichuanqi0086@163.com
 * @date 2021-02-21 18:00:14
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void add(Long skuId, Long wareId, Integer skuNum);

    Boolean hasStock(Long skuId);

    List<SkuStockVo> hasStocks(List<Long> skuIds);

    void lockWare(WareSkuLockVo wareSkuLockVo);

    void releaseLockWare(StockLockedTo lockedTo);

    void releaseLockWare(OrderTo orderTo);
}

